<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      >

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet name="default.css" library="css"/>
        <h:outputStylesheet name="tableLayout.css" library="css"/>
        <h:outputStylesheet name="formathlon.css" library="css"/>
        <title><ui:insert name="title"></ui:insert> - #{msg['application.nom']}</title>
        <h:outputScript name="locale.js" library="js"/>
    </h:head>

    <h:body>
        <h:form id="globalForm">
            <p:growl id="messages" />
            <table  style="width:100%" border="0" cellpadding="3px">

                <tr>
                    <td id="baniere" colspan="2">
                        <!-- Bandeau du site  -->

                        <table style="width: 100%" border="0">
                            <tr><td>
                                    <!-- decalage du tableau pour deplacer le titre -->
                                    <h:graphicImage name="spacer.gif" library="images" width="50" height="1"/>    
                                    <h:graphicImage name="formathlon_titre.png" library="images"/>
                                </td><td style="text-align: right;vertical-align: bottom">
                                    <h:panelGroup rendered="#{loginControler.authentifie}" >
                                        <h:commandLink action="#{loginControler.logOut()}"  ><h:graphicImage name="deconnexion.png" library="images"/></h:commandLink><br/>
                                    <h:commandLink value="#{loginControler.login}" action="#{loginControler.logOut()}"  />
                                    </h:panelGroup>
                                    
                                    <h:panelGroup rendered="#{!loginControler.authentifie}" >
                                        <h:commandLink action="/pages/login/login.xhtml"  ><h:graphicImage name="deconnexion.png" library="images"/></h:commandLink><br/>
                                        <h:commandLink value="Se connecter" action="/pages/login/login.xhtml"  />
                                    </h:panelGroup>

                                </td></tr>
                        </table>

                        <!-- Bandeau du site  -->
                    </td>
                </tr>
                <tr>
                    <td id="ariane" colspan="2">
                        <ui:insert name="ariane">Accueil</ui:insert>
                    </td>
                </tr>
                <tr >
                    <td id="left" style="width:210px;">
                        <p:menu style="width: 200px"  rendered="#{loginControler.admin}">
                            <p:submenu label="Administration"> 
                                <p:menuitem url="/faces/pages/admin/personnel/comptes_utilisateurs_liste.xhtml" value="Liste des comptes utilisateurs"  />
                                <p:menuitem url="/faces/pages/admin/personnel/personnels_liste.xhtml" value="Liste des personnels"  />
                                <p:menuitem url="/faces/pages/admin/personnel/utilisateur_gestion.xhtml" value="Ajout d'un utilisateur"  />
                                <p:menuitem url="/faces/pages/admin/salle/salle.xhtml" value="Administrer les Salles"  />
                            </p:submenu>
                        </p:menu>  

                        <p:menu style="width: 200px" rendered="#{loginControler.gestionnaire}">
                            <p:submenu label="Gestionnaire"> 
                                <p:menuitem url="/faces/pages/gest/domaine/domaine_liste.xhtml" value="Gérer les Domaines"  />
                                <p:menuitem url="/faces/pages/gest/formation/formation_liste.xhtml" value="Gérer les Formations"  />
                                <p:menuitem url="/faces/pages/gest/session/session_liste.xhtml" value="Gérer les Sessions"  />
                                <p:menuitem url="/faces/pages/gest/posteriori/saisie_posteriori.xhtml" value="Sessions Postérieures"  />
                            </p:submenu>
                        </p:menu>

                        <p:menu style="width: 200px" rendered="#{loginControler.authentifie and !loginControler.admin}">
                            <p:submenu label="Utilisateur">
                                <p:menuitem  url="/faces/pages/user/suivi_formation/attestation/parcours_peda.xhtml" value="Parcours pédagogique" />
                                <p:menuitem  url="/faces/pages/user/demande/demande_liste.xhtml" value="Valider les demandes#{userDemandeBean.nbDemande}" 
                                             rendered="#{loginControler.chefCours || loginControler.chefDivision}"/>
                                <p:menuitem  url="/faces/pages/user/session/gerer_session.xhtml" value="Gérer ses sessions" 
                                             rendered="#{loginControler.instructeur}"/>
                                <p:menuitem  url="/faces/pages/user/inscription/gerer_inscription.xhtml" value="Gérer ses inscriptions" 
                                             rendered="#{loginControler.utilisateur}"/>
                            </p:submenu>
                        </p:menu>

                        <p:menu style="width: 200px">
                            <p:submenu label="Visiteur"> 
                                <p:menuitem  url="/faces/pages/visitor/visitor_session.xhtml" value="Visualiser les sessions" />
                                <p:menuitem  url="/faces/pages/visitor/visitor_planning.xhtml" value="Visualiser le planning" />
                                <p:menuitem  url="/faces/pages/visitor/chart.xhtml" value="Niveau de formation" />
                            </p:submenu>
                        </p:menu>


                    </td>
                    <td id="basPageContent">
                        <ui:insert name="content">Content</ui:insert>
                    </td>
                </tr>
                <tr>
                    <td id="bottom" colspan="2" style="text-align:center">
                        <h1 class="title ui-widget-header ui-corner-all"> ©2012 All Rights Reserved • Design by <p:commandLink value="OPIF" onclick="dlgOpif.show();" id="lien_OPIF" style="text-decoration: none;color: #ffffff"/> </h1> 
                    </td>
                </tr>
            </table>

            <p:dialog header="Organisation et Planification Interarmée des Formations (OPIF)" widgetVar="dlgOpif" modal="true" height="400" width="550">  
                <h:outputText value="Ici apparaitra le Logo d'OPIF." /><br/>
                <p:commandLink action="#" value="Nous contacter"  />
            </p:dialog>

            <h:panelGroup id="popup">
                <p:dialog header="#{popupBean.titre}"
                          modal="true"
                          visible="#{popupBean.visible}">
                    <ui:insert name="popup"></ui:insert>
                </p:dialog>
            </h:panelGroup>

            <h:panelGroup id="confirm">
                <p:confirmDialog message="#{confirmationBean.message}"
                                 header="#{confirmationBean.titre}"
                                 visible="#{confirmationBean.visible}"
                                 severity="alert">  

                    <p:commandButton value="Oui"
                                     action="#{confirmationBean.confirmer}"
                                     onclick="hide()"
                                     ajax="false"
                                     update="messages globalForm:confirm globalForm"/>
                    <p:commandButton value="Non"
                                     action="#{confirmationBean.infirmer}"
                                     onclick="hide()"
                                     update="messages globalForm:confirm"/>   

                </p:confirmDialog>
            </h:panelGroup>

        </h:form>    
    </h:body>

</html>
